﻿@model PagedList<BankData>
<style type="text/css">
    #MainContent .SearchContent
    {
        min-width: 2200px;
    }
</style>
<table class="table">
    <thead>
        <tr>
            @if (User.IsInRole("FINACE"))
            {
                <th style="width: 20px">
                    <input type="checkbox" onclick="CheckAll()" id="checkAll" />
                </th>
            }
            <th style="width: 80px">
                上传日期
            </th>
            <th style="width: 120px">
                账单编号
            </th>
            <th style="width: 80px">
                银行
            </th>
            <th style="width: 80px">
                收款类型
            </th>
            <th style="width: 80px">
                到账日期
            </th>
            <th style="width: 150px;">
                付款人
            </th>
            <th style="width: 80px;">
                客户编号
            </th>
            <th style="width: 80px">
                客户名称
            </th>
            <th style="width: 40px">
                币种
            </th>
            <th style="width: 80px">
                实际收款
            </th>
            <th style="width: 70px">
                手续费
            </th>
            <th style="width: 150px">
                交易附言
            </th>
            <th style="width: 100px">
                交易附言2
            </th>
            <th style="width: 100px">
                银行备注
            </th>
            <th style="width: 80px">
                已认款
            </th>
            <th style="width: 80px">
                已退款
            </th>
            <th style="width: 70px">
                导入SAP
            </th>
            <th style="width: 70px">
                CSR签出
            </th>
            <th style="width: 70px">
                共享签出
            </th>
            <th style="width: 40px">
                废除
            </th>
            <th style="width: 70px">
                DocumentNo
            </th>
            <th style="width: 70px">
                财务签出
            </th>
            <th style="width: 70px">
                收款凭证
            </th>
            <th style="width: 70px">
                转账凭证
            </th>
            <th style="width: 86px;">
            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                @if (User.IsInRole("FINACE"))
                {
                    <td>
                        @if (item.IsCanFinanceCheck())
                        {
                            <input name="selected" type="checkbox" value="@item.Id" />
                        }
                    </td>
                }
                <td>@item.AccountDate.ToCommonStr2()
                </td>
                <td>@Html.DetailsLink(item.Id, item.Assiginment)
                </td>
                <td style="width: 70px">@BindDropDownList.GetBankName(item.BankCode)
                </td>
                <td>@BindDropDownList.GetReceiveTypeName(item.ReceiveType)
                </td>
                <td>@Html.DisplayFor(m => item.ReceiveDate)
                </td>
                <td>@item.Payer
                </td>
                <td style="width: 80px;">@item.CustomerCode
                </td>
                <td style="width: 80px;">@item.CustomerName
                </td>
                <td>@item.Currency
                </td>
                <td>@Html.DisplayFor(m => item.BankPaidIn)
                </td>
                <td>@Html.DisplayFor(m => item.BankServiceFee)
                </td>
                <td style="width: 150px;">@Html.DisplayFor(m => item.LCNumber)
                </td>
                <td style="width: 100px;">@Html.DisplayFor(m => item.TradeAddionalComment)
                </td>
                <td>@Html.DisplayFor(m => item.BankRemarkNum)
                </td>
                <td>@item.Paymented()
                </td>
                <td>@item.Refundmented()
                </td>
                <td>@Html.DisplayFor(m => item.ImportSAP)
                </td>
                <td>
                    @(item.HasChecked() ? "是" : "否")
                </td>
                <td>
                    @(item.Shared() ? "是" : "否")
                </td>
                <td>@Html.DisplayFor(m => item.IsDelete)
                </td>
                <td>@Html.DisplayFor(m => item.DocumentNo)
                </td>
                <td>@Html.DisplayFor(m => item.FinanceCheckOut)
                </td>
                <td>@Html.DisplayFor(m => item.GenerateRecieveVoucher)
                </td>
                <td>@Html.DisplayFor(m => item.GenerateTransferVoucher)
                </td>
                <td style="width: 80px;">
                    @if (User.IsInRole("FINACE"))
                    { //财务
                        @Html.ShortcutLink("锁定", "Lock", new { item.Id }, condition: item.IsCanLock())
                        @Html.ShortcutLink("恢复账单", "RestoreRemove", new { item.Id }, condition: item.IsDelete)
                        @Html.ShortcutLink("废除账单", "Delete", new { item.Id }, condition: item.IsDelete == false)
                        @Html.EditLink(item.Id ,"修改DocumentNo",action: "UpdateDocumentNO" , condition: item.GenerateTransferVoucher)
                    }
                    @if (item.Status == 2)
                    {// Complaince
                        @Html.ShortcutLink("撤销锁定", "UnLock", new { item.Id }, condition: User.IsInRole("5"))
                    }
                    else
                    {
                        if (User.IsInRole("CSR"))
                        {//CSr
                        @Html.ShortcutLink("签出账单", "CheckIn", new { item.Id }, condition: item.IsCanCSRCheck())
                        @Html.EditLink(item.Id, "申请争议", action: "ApplyDispute", condition: item.IsCanDispute(User.Identity.Name))
                        }
                    }
                </td>
            </tr>
        }
    </tbody>
</table>
@Html.CommonPager(Model, ViewData["SearchModel"])
